Script to change Public Views to Private Views

On the old forums there was a thread about a script to change public views to private views. The script wasn't attached to the thread though. Does anyone have a script to do this?

Thanks.
SystemAdmin - Tue Sep 29 16:20:48 EDT 2009

Re: Script to change Public Views to Private Views
SystemAdmin - Wed Sep 30 01:35:08 EDT 2009

I think you're referring to a posting made by Tony Goodman on the 2nd May 2007. The script he posted is as follows.

Louie Landale correctly pointed out in that thread "You'll need to run that as the 'Administrator' as views tend to be writable only by the author."

// Make all views private by removing "Everyone Else" permissions
string s   = ""   //Will store the name of a view
string res = ""   //Will store the returned result from a function
View   v   = null
 
for s in views(current Module) do    //For all views in the current module
{
    v = view s               //Handle to the current view
        res = set(v, none, null) //set the access rights for the 'Everyone else' group to 'None'
        if (!null res)
        {
                print("Error setting permissions on view " s "." res "\n")
        }
}

 

 


Paul Miller
Specification Practices Specialist
EuroCyber
Melbourne, Australia